import request from './axios'

// 封装 ip查询城市的方法请求
export const getCity = (myKey) => {
    return request.get(`/ip?&key=${myKey}`)
}

// 封装 通常城市名称查询adcode
export const getCode = (city, myKey) => {
    return request.get(`/geocode/geo?address=${city}&key=${myKey}`)
}

// 封装 通过城市code查询天气
export const codeWeather = (code, myKey) => {
    return request.get(`/weather/weatherInfo?city=${code}&key=${myKey}&extensions=base`)
}

// 封装 通过城市code查询天气
export const weatherForecast = (code, myKey) => {
    return request.get(`/weather/weatherInfo?city=${code}&key=${myKey}&extensions=all`)
}

// 封装 输入提示方法
export const inputTip = (word, myKey) => {
    return request.get(`/assistant/inputtips?&keywords=${word}&key=${myKey}`)
}


